package com.smartcruise.main.selfFragment.setting.VerifyPasswordFragment;

import com.smartcruise.util.network.callBack.SimpleCallBack;
import com.smartcruise.util.network.netUtils.NetCollection;
import com.smartcruise.util.network.netUtils.Result;

/**
 * Created by FengChaoQun
 * on 2018/3/17 0017
 */

public class VerifyPasswordPresenterImp implements VerifyPasswordContract.Presenter {

    private VerifyPasswordContract.View mView;

    public VerifyPasswordPresenterImp(VerifyPasswordContract.View mView) {
        this.mView = mView;
    }

    @Override
    public void start() {

    }

    @Override
    public void clickOnSubmit() {
        NetCollection.checkPassword(mView.getPassword(), mView, new SimpleCallBack(mView) {
            @Override
            public void onSuccess(Result result) {
                if ("true".equals(result.getData())) {
                    mView.gotoSetPassword();
                } else {
                    mView.showToast("密码错误");
                }
            }
        });
    }
}
